<!DOCTYPE html>
<html>

<head>
<meta charset="UTF-8">
<title>后台管理首页</title>
<script type="text/javascript" src="../../../staticresource/js/jquery.min.js"></script>
<script type="text/javascript" src="../../../staticresource/js/base/base.js"></script>
<script type="text/javascript"
	src="../../../staticresource/js/jquery-easyui-1.4.4/jquery.easyui.min.js"></script>
<script type="text/javascript"
	src="../../../staticresource/js/jquery-easyui-1.4.4/easyui-lang-zh_CN.js"></script>
<link rel="stylesheet"
	href="../../../staticresource/js/jquery-easyui-1.4.4/themes/default/easyui.css" />
<link rel="stylesheet"
	href="../../../staticresource/js/jquery-easyui-1.4.4/themes/icon.css" />
<style>
.menuul {
	padding: 0px;
	margin: 0px;
}

.menuul li {
	list-style: none;
	text-align: center;
	height: 30px;
	line-height: 30px;
	border-bottom: 1px solid #95B8E7;
}

.menuul li:last-child {
	border-bottom: none;
}

.menuul li:hover {
	cursor: pointer;
	color: green;
}
</style>
</head>

<body class="easyui-layout">
	<div region="north" title="North Title" split="true"
		style="height: 100px;"></div>
	<div region="west" split="true" title="导航菜单" style="width: 180px;">
		<div id="menudiv">
			<!-- <div title="权限设置">
				<ul class="menuul">
					<li class="menuli" data-href="system/rolemanager">角色管理</li>
					<li class="menuli" data-href="system/resourcemanager">资源管理</li>
					<li class="menuli" data-href="system/roleresourcemanager">角色授权</li>
				</ul>
			</div>
			<div title="用户管理">
				<ul class="menuul">
					<li class="menuli" data-href="system/usermanager">增加用户</li>
				</ul>
			</div>
			<div title="日志分析">
				<ul class="menuul">
					<li class="menuli">登录日志</li>
					<li class="menuli">操作日志</li>
					<li class="menuli">异常日志</li>
					<li class="menuli">日志分析</li>
				</ul>
			</div>
			<div title="系统设置">
				<ul class="menuul">
					<li class="menuli">日志设置</li>
					<li class="menuli">皮肤设置</li>
				</ul>
			</div> -->
		</div>
	</div>
	<div id="content" region="center"
		style="padding: 5px; background: #eee;"></div>
	<!-- <div region="east" title="East" split="true"
		style="width: 200px;"></div> -->
</body>
<script type="text/javascript">
	$(function() {
		//给菜单注册点击事件
		$(document).off("click", ".menuli");
		$(document).on("click", ".menuli", function() {
			var url = this.getAttribute("data-href");
			loadPageToContent(url);
		});
		//初始化当前登录用户的菜单
		initCurrentUserMenus();
	})
	//初始化当前登录用户菜单
	function initCurrentUserMenus() {
		$("#menudiv").html("");
		$.ajax({
			url : basePath + "system/initCurrentUserMenus",
			type : "post",
			dataType : "json",
			success : function(result) {
				//生存菜单
				var dom = [];
				for (var i = 0; i < result.length; i++) {
					dom.push('<div title="'+result[i].text+'">');
					if (result[i].children) {
						dom.push('<ul class="menuul">');
						for (var j = 0; j < result[i].children.length; j++) {
							dom.push('<li class="menuli" data-href="'+result[i].children[j].url+'">'
									+ result[i].children[j].text + '</li>');
						}
						dom.push('</ul>');
					}
					dom.push('</div>');
				}
				$("#menudiv").append(dom.join(""));
				$('#menudiv').accordion({animate:true});
			}
		})
	}
</script>
</html>